{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<!-- <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/user_glb.css?version={$version}"> -->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/front/front_css/refresh_load.css?version={$version}"/>
<style type="text/css">
    body{
    	padding-top:2.2rem;
    }
    #load_wrapper{
    	top:2.2rem;
    }
</style>
{/block}
{block name="content"}
{include file="../common_header.html"}
<div id="load_wrapper">
<div id="scroller">
<div id="pullDown">
    <span class="pullDownIcon"></span>
</div>
    <ul class="clearfix project_type_tab">
        <li class="fl">
            <div class="type_tab_box clearfix">
                <p class="fl " id="status">活动阶段</p>
                <i class="fl icon icon_screen_default3x icon_up3x"></i>
            </div>
        </li>
        <li class="fl">
            <div class="type_tab_box clearfix">
                <p class="fl" id="place">地域</p>
                <i class="fl icon icon_screen_default3x icon_up3x"></i>
            </div>
        </li>
    </ul>
    <!--<div class="project_bg" style="display:none;"></div>-->
    <div class="project_type_list">
        <dl class="project_tab_menu" style="display:none;">
            <dd class="clearfix active click_status"  data-value="-1">
                <p class="fl status">全部</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            <dd class="clearfix click_status" data-value="1">
                <p class="fl status" >预告中</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
           <!-- <dd class="clearfix click_status" data-value="2">
                <p class="fl status" >报名中</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>-->
            <dd class="clearfix click_status" data-value="3">
                <p class="fl status" >进行中</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            <dd class="clearfix click_status" data-value="4">
                <p class="fl status" >已结束</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
        </dl>
        <dl class="project_tab_menu" style="display:none;">
            <dd class="clearfix active city_id" data-city_id="-1">
                <p class="fl">全部</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            {foreach from=$city_list_name item=city key=key}
            <dd class="clearfix city_id" data-city_id={$key}>
                <p class="fl">{$city}</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            {/foreach}
           <!-- <dd class="clearfix">
                <p class="fl">金融投资地域</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>
            <dd class="clearfix">
                <p class="fl">金融投资地域</p>
                <i class="fr icon icon_sele3x"></i>
            </dd>-->
        </dl>
    </div>
<div class="activity_list">
{foreach from=$activity_list item=activity}
<a href="/FrontActivity/activity_detail/activity_id/{$activity.activity_id}" class="activity_bg">
    <img src="{$activity.first_pic}" alt="" />
    <div class="activity_bg_box">
        <h6>{$activity.activity_title}</h6>
        <p>{$activity.sponsor}</p>
        <span>{$activity.status}</span>
    </div>
</a>
{/foreach}
</div>
<div id="pullUp">
    <span class="pullUpIcon"></span><span class="pullUpLabel">上拉加载...</span>
</div>
</div>
</div>
<div class="project_bg" style="display:none;"></div>
<!--<a href="" class="activity_bg">
    <img src="/Public/Images/front/front_img/cxq_banner3x.png" alt="" />
    <div class="activity_bg_box">
        <h6>欢度元宵节</h6>
        <p>杭州微斯代信息技术有限公司</p>
        <span>预告中</span>
    </div>
</a>
<a href="" class="activity_bg">
    <img src="/Public/Images/front/front_img/cxq_banner3x.png" alt="" />
    <div class="activity_bg_box">
        <h6>欢度元宵节</h6>
        <p>杭州微斯代信息技术有限公司</p>
        <span>预告中</span>
    </div>
</a>
<a href="" class="activity_bg">
    <img src="/Public/Images/front/front_img/cxq_banner3x.png" alt="" />
    <div class="activity_bg_box">
        <h6>欢度元宵节</h6>
        <p>杭州微斯代信息技术有限公司</p>
        <span>预告中</span>
    </div>
</a>-->
{/block}
{block name="js"}

 <script type="text/javascript" src="__PUBLIC__/Js/front/iscroll.js"></script> 
<script type="text/javascript" src="__PUBLIC__/Js/front/front_js/circle.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/front/front_js/activity_list.js"></script>
        <script type="text/javascript">
        var sign = '{$sign}'
        var total='{$total}'
        var firstRow='{$firstRow}';
        var key_words='{$key_words}';
        var status='';
        var city_id='';
        {literal}
            $(function()
            {
                /*$(".service_header i,.service_header span").on("click",function()
                {
                    history.go(-1);
                });*/
            });
            $('.click_status').on('click',function(){
                //$(".title").val($(this).value);
                $("#status").html($(this).children("p").html());
                $(".pullUpIcon").show();
                $(".pullUpLabel").show();
                $(".pullUpLabel").html("上拉加载...");
                status=$(this).attr('data-value');
               /* city_id='';*/
                $.ajax({
                    url:'/FrontActivity/filter_activity_list',
                    type:'post',
                    dataType:'json',
                    data:{'status':status, 'sign':sign,'key_words':key_words,'city_id':city_id},
                    success:function(data){
                       // console.log(data)
                        total=data.total;
                        num=1;
                        if(total<=firstRow*(num))
                        {
                            $(".pullUpIcon").hide();
                            $(".pullUpLabel").html("没有更多了");
                        }
                        console.log(total+'--'+firstRow*num);
                        if(data.data==null){
                           $('.activity_list').html('<p style="width:100%;height:2rem;text-align:center;line-height:2rem;font-size:0.8rem;">当前没有内容哦</p>');
                            $(".pullUpIcon").hide();
  	                        $(".pullUpLabel").hide();
                        }else{
                            var len=data.data.length;
                            var html='';
                            for(var i=0;i<len;i++){
                                html+='<a href="/FrontActivity/activity_detail/activity_id/'+data.data[i].activity_id+'" class="activity_bg">'+
                                                ' <img src="'+data.data[i].first_pic+'" alt="" />'+
                                                ' <div class="activity_bg_box">'+
                                                '<h6>'+data.data[i].activity_title+'</h6>'+
                                                '<p>'+data.data[i].sponsor+'</p>';
                                html+=' <span>'+data.data[i].status+'</span>';
                                html+='</div></a>';
                            }
                        $('.activity_list').html(html);
                        }
                    }
                    })
                })

            $('.city_id').on('click',function(){
                $("#place").html($(this).children("p").html());
                $(".pullUpIcon").show();
                $(".pullUpLabel").show();
                $(".pullUpLabel").html("上拉加载...");
                city_id=$(this).attr('data-city_id');
                $.ajax({
                    url:'/FrontActivity/filter_activity_list',
                    type:'post',
                    dataType:'json',
                    data:{'city_id':city_id,'sign':sign,'status':status},
                    success:function(data){
                        // console.log(data)
                        total=data.total;
                        num=1;
                        if(total<=firstRow*(num))
                        {
                            $(".pullUpIcon").hide();
                            $(".pullUpLabel").html("没有更多了");
                        }
                        console.log(total+'--'+firstRow*num);
                        if(data.data==null){
                            $('.activity_list').html('<p style="width:100%;height:2rem;text-align:center;line-height:2rem;font-size:0.8rem;">当前没有内容哦</p>');
                            $(".pullUpIcon").hide();
                            $(".pullUpLabel").hide();
                        }else{
                            var len=data.data.length;
                            var html='';
                            for(var i=0;i<len;i++){
                                html+='<a href="/FrontActivity/activity_detail/activity_id/'+data.data[i].activity_id+'" class="activity_bg">'+
                                        ' <img src="'+data.data[i].first_pic+'" alt="" />'+
                                        ' <div class="activity_bg_box">'+
                                        '<h6>'+data.data[i].activity_title+'</h6>'+
                                        '<p>'+data.data[i].sponsor+'</p>';
                                html+=' <span>'+data.data[i].status+'</span>';
                                html+='</div></a>';
                            }
                            $('.activity_list').html(html);
                        }
                    }
                })
            })
        </script>
{/literal}
{/block}